home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / expect / fixline1 < prev    next >
Text File  |  1993-03-02  |  530b  |  26 lines

  1. #!expect -f
  2. # Synopsis: expect fixline1 newpath < input > output
  3. # Author: Don Libes
  4.  
  5. # Description: change first line of script to reflect new binary
  6.  
  7. set newpath [lindex $argv 1]
  8.  
  9. gets stdin buf
  10.  
  11. # try to match any of the following match
  12. #!expect ...
  13. #!../expect ...
  14. #!expectk ...
  15. #!foobar/expectk ...
  16. if 1==[regexp "^#!(.*/)*(.*)" $buf dummy1 dummy2 tail] {
  17.     puts stdout "#!$newpath/$tail"
  18. #    puts stdout "#!$new/ [lrange [split $buf " "] 1 end]"
  19. } else {
  20.     puts stdout $buf
  21. }
  22.  
  23. while {-1!=[gets stdin buf]} {
  24.     puts stdout $buf
  25. }
  26.